﻿using System;
using System.IO;

namespace ConsoleApp10
{
    class Program
    {
        static void Main(string[] args)
        {
            bool flag = Directory.Exists("C:\\mySolo");
            if (flag)
            {
                Directory.Delete("C:\\mySolo", true);
            }
            else
            {
                Directory.CreateDirectory("C:\\mySolo");
            }
          
            FileInfo file = new FileInfo("C:\\mySolo\\test.txt");
            Console.WriteLine("文件名称：" + file.Name );
            Console.WriteLine("文件创建时间：" + file.CreationTime);
            Console.WriteLine("文件路径：" + file.DirectoryName);
            file.Create();
            string path = "C:\\mySolo\\test.txt";

            StreamWriter streamWriter = new StreamWriter(path);

            streamWriter.WriteLine("许梦婷");

            streamWriter.WriteLine(19);
            streamWriter.WriteLine("床前明月光疑是地上霜");

            streamWriter.Flush();

            streamWriter.Close();
        }
        }
    }

